// 实现bfs
export function bfs(graph: Graph, start: string): string[] {
  const visited: string[] = [];
  const queue: string[] = [start];
  while (queue.length > 0) {
    const node = queue.shift();
    if (visited.includes(node!)) continue;
    visited.push(node!);
    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
    queue.push(...graph[node!]);
  }
  return visited;
}
interface Graph {
  [key: string]: string[];
}
